<?php
/* @var $this UserController */
$this->layout = '//layouts/admin/user';
$this->pageTitle = $model->isNewRecord ? '添加用户' : '编辑用户' . '【'.$model->username.'】' . '信息';
?>
<style>
.tagsinput input {
    width:100px;
}
.select .btn{
    padding:3px;
}
.select .btn .filter-option{
    top:3px;
}
</style>
<div class="container container-admin">
    <div class='row'>
        <div class="span3">
            <?php $this->beginWidget('AdminLeftNavWidget');$this->endWidget();?>
        </div>
        <div class='span9'>
            <div class='page-header' style='width:106%'>
                <h2>
                    <span class='fui-new'></span>
                    <?php echo $model->isNewRecord ? '添加新用户' : '编辑用户信息'?>
                    <small>
                        <a href='#'>
                            <?php echo $model->isNewRecord ? '' : '查看用户'?>
                        </a>
                    </small>
                </h2>
            </div>
            <div class="row">
                <?php $form=$this->beginWidget('CActiveForm', array(
                    'id'=>'blog-form',
                    'enableAjaxValidation'=>true,
                    'htmlOptions'=>array(
                        'class'=>'form-horizontal',
                    )
                )); ?>

                <div class='span7 left'>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'username',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textField($model,'username',array('class'=>'span7','placeholder'=>'输入用户的登录名','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'username',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'password',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->passwordField($model,'password',array('class'=>'span7','placeholder'=>'输入用户的登录密码','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'password',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'email',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textField($model,'email',array('class'=>'span7','placeholder'=>'请输入Email地址','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'email',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'qq',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textField($model,'qq',array('class'=>'span7','placeholder'=>'请输入QQ帐号','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'qq',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'weibo',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textField($model,'weibo',array('class'=>'span7','placeholder'=>'请输入weibo帐号','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'weibo',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'phone',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textField($model,'phone',array('class'=>'span7','placeholder'=>'请输入手机号','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'phone',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'profile',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->textarea($model,'profile',array('class'=>'span7','placeholder'=>'请输入用户的简介','style'=>'padding:5px')); ?>
                            <?php echo $form->error($model,'profile',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="">
                            <?php echo CHtml::submitButton($model->isNewRecord ? '添加用户' : '更新用户信息',array('class'=>'btn btn-primary','style'=>'padding:5px')); ?>
                        </div>
                    </div>
                </div>
                <div class='span2 right'>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'sex',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->dropDownList($model,'sex',$sexs); ?>
                            <?php echo $form->error($model,'sex',array('class'=>'alert')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'role_id',array('class'=>'')); ?>
                        <div class="">
                            <?php echo $form->dropDownList($model,'role_id',Type::getCategoryList('user')); ?>
                            <?php echo $form->error($model,'role_id',array('class'=>'alert')); ?>
                        </div>
                    </div>
                </div>
                <?php $this->endWidget();?>
            </div>
        </div>
    </div>
</div>